package model;

import model.Contact;

/**
 * 
 * @author Mickael
 *
 */
public class Contact {

	private int id;

	private String firstName;
    private String lastName;
    private String homeAddress;
    private String companyAddress;
    private String personalPhone;
    private String professionalPhone;
    private String homePage;
    private String email;
    private String photo;
    private String ICQ;
    private String notes;
    

	public Contact(){
		this.firstName = "";
		this.lastName = "";
		this.homeAddress = "";
		this.companyAddress = "";
		this.personalPhone = "";
		this.professionalPhone = "";
		this.homePage = "";
		this.email = "";
		this.photo = "";
		this.ICQ = "";
		this.notes="";
    }


	/**
	 * 
	 * @param firstName
	 * @param lastName
	 * @param homeAddress
	 * @param companyAddress
	 * @param personalPhone
	 * @param professionalPhone
	 * @param homePage
	 * @param email
	 * @param photo
	 * @param iCQ
	 * @param notes
	 */
	public Contact(String firstName, String lastName, String homeAddress,
			String companyAddress, String personalPhone,
			String professionalPhone, String homePage, String email,
			String photo, String iCQ, String notes) {
		super();
		this.firstName = firstName;
		this.lastName = lastName;
		this.homeAddress = homeAddress;
		this.companyAddress = companyAddress;
		this.personalPhone = personalPhone;
		this.professionalPhone = professionalPhone;
		this.homePage = homePage;
		this.email = email;
		this.photo = photo;
		this.notes=notes;
		ICQ = iCQ;
	}

	/**
	 * 
	 * @return firstName du contact
	 */
	public String getFirstName() {
		return firstName;
	}


	/**
	 * Modifie firstName du contact
	 * @param firstName
	 */
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}


	/**
	 * 
	 * @return lastName du contact
	 */
	public String getLastName() {
		return lastName;
	}


	/**
	 * Modifie lastName du contact
	 * @param lastName
	 */
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}


	/**
	 * 
	 * @return homeAddress du contact
	 */
	public String getHomeAddress() {
		return homeAddress;
	}


	/**
	 * Modifie homeAdress du contact
	 * @param homeAddress
	 */
	public void setHomeAddress(String homeAddress) {
		this.homeAddress = homeAddress;
	}


	/**
	 * 
	 * @return companyAdress du contact
	 */
	public String getCompanyAddress() {
		return companyAddress;
	}


	/**
	 * Modifie companyAdress du contact
	 * @param companyAddress
	 */
	public void setCompanyAddress(String companyAddress) {
		this.companyAddress = companyAddress;
	}


	/**
	 * 
	 * @return personnalPhone du contact
	 */
	public String getPersonalPhone() {
		return personalPhone;
	}


	/**
	 * Modifie personnalPhone du contact
	 * @param personalPhone
	 */
	public void setPersonalPhone(String personalPhone) {
		this.personalPhone = personalPhone;
	}

	/**
	 * 
	 * @return professionalPhone du contact
	 */
	public String getProfessionalPhone() {
		return professionalPhone;
	}


	/**
	 * Modifie professionalPhone du contact
	 * @param professionalPhone
	 */
	public void setProfessionalPhone(String professionalPhone) {
		this.professionalPhone = professionalPhone;
	}


	/**
	 * 
	 * @return homePage du contact
	 */
	public String getHomePage() {
		return homePage;
	}

	
	/**
	 * Modifie homePage du contact
	 * @param homePage
	 */
	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}


	/**
	 * 
	 * @return email du contact
	 */
	public String getEmail() {
		return email;
	}


	/**
	 * Modifie email du contact
	 * @param email
	 */
	public void setEmail(String email) {
		this.email = email;
	}


	/**
	 * 
	 * @return le chemin de la photo du contact
	 */
	public String getPhoto() {
		return photo;
	}


	/**
	 * Modifie le chemin de la photo du contact
	 * @param photo
	 */
	public void setPhoto(String photo) {
		this.photo = photo;
	}


	/**
	 * 
	 * @return ICQ du contact
	 */
	public String getICQ() {
		return ICQ;
	}


	/**
	 * Modifie l'CIQ
	 * @param iCQ
	 */
	public void setICQ(String iCQ) {
		ICQ = iCQ;
	}


	
    @Override
	public String toString() {
		return firstName + " - " + lastName;
	}

    /**
     * 
     * @return id du contact
     */
	public int getId() {
		return id;
	}
	/**
	 * 
	 * @return notes du contact
	 */
    public String getNotes() {
		return notes;
	}

    /**
     * Modifie les notes du contact
     * @param notes
     */
	public void setNotes(String notes) {
		this.notes = notes;
	}

	/**
	 * Modifie l'id du contact
	 * @param id
	 */
	public void setId(int id) {
		this.id = id;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((ICQ == null) ? 0 : ICQ.hashCode());
		result = prime * result
				+ ((companyAddress == null) ? 0 : companyAddress.hashCode());
		result = prime * result + ((email == null) ? 0 : email.hashCode());
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result
				+ ((homeAddress == null) ? 0 : homeAddress.hashCode());
		result = prime * result
				+ ((homePage == null) ? 0 : homePage.hashCode());
		result = prime * result + id;
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		result = prime * result + ((notes == null) ? 0 : notes.hashCode());
		result = prime * result
				+ ((personalPhone == null) ? 0 : personalPhone.hashCode());
		result = prime * result + ((photo == null) ? 0 : photo.hashCode());
		result = prime
				* result
				+ ((professionalPhone == null) ? 0 : professionalPhone
						.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Contact other = (Contact) obj;
		if (ICQ == null) {
			if (other.ICQ != null)
				return false;
		} else if (!ICQ.equals(other.ICQ))
			return false;
		if (companyAddress == null) {
			if (other.companyAddress != null)
				return false;
		} else if (!companyAddress.equals(other.companyAddress))
			return false;
		if (email == null) {
			if (other.email != null)
				return false;
		} else if (!email.equals(other.email))
			return false;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (homeAddress == null) {
			if (other.homeAddress != null)
				return false;
		} else if (!homeAddress.equals(other.homeAddress))
			return false;
		if (homePage == null) {
			if (other.homePage != null)
				return false;
		} else if (!homePage.equals(other.homePage))
			return false;
		if (id != other.id)
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		if (notes == null) {
			if (other.notes != null)
				return false;
		} else if (!notes.equals(other.notes))
			return false;
		if (personalPhone == null) {
			if (other.personalPhone != null)
				return false;
		} else if (!personalPhone.equals(other.personalPhone))
			return false;
		if (photo == null) {
			if (other.photo != null)
				return false;
		} else if (!photo.equals(other.photo))
			return false;
		if (professionalPhone == null) {
			if (other.professionalPhone != null)
				return false;
		} else if (!professionalPhone.equals(other.professionalPhone))
			return false;
		return true;
	}


	
	
	
}
